package com.example.springboot.mapper;

import com.example.springboot.entity.Earnings;
import org.apache.ibatis.annotations.Mapper;
import com.example.springboot.entity.Earnings;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Mapper

public interface EarningsMapper {
    List<Earnings> findByMerchantId(int merchantId);

    List<Earnings> findByAdminId(int adminId);
    List<Earnings> findAll();
    BigDecimal getTotalEarningsByMerchantId(int merchantId);
    BigDecimal getTotalPlatformEarnings();
    BigDecimal getTotalMerchantEarnings();

    List<Earnings> findByConditions(@Param("startTime") Date startTime,
                                    @Param("endTime") Date endTime,
                                    @Param("orderType") String orderType);

    BigDecimal getTotalPlatformEarningsByDateRange(@Param("startTime") Date startTime,
                                                   @Param("endTime") Date endTime);

    BigDecimal getTotalEarningsByAdminId(@Param("adminId") int adminId);

    BigDecimal getSelfServiceEarningsByAdminId(@Param("adminId") int adminId);
    BigDecimal  getPlatformTotalByAdminId(@Param("adminId") int adminId);
    BigDecimal getMerchantTotalByAdminId(@Param("adminId") int adminId);

}
